import { WeaLocaleProvider } from 'ecCom';
import defaultData from "./data";
import Props from "../base/Props";
import DefaultVal from '../../../../common/default-value';
import Validate from './validate';

const { getLabel } = WeaLocaleProvider;
const { custom: { validate } } = Validate;

export default class EmailProps extends Props {
  renderDefaultValue() {
    const { data } = this.props;
    const { defaultValue } = data;

    return (
      <DefaultVal ecId={`${this && this.props && this.props.ecId || ''}_DefaultVal@kdbok3`}
        validate={validate} 
        value={defaultValue}
        placeholder={getLabel('522815','请输入正确的邮箱地址，或系统支持的变量字段')}
        errorTip={getLabel('522816', '请输入正确的邮箱地址或系统变量')}
        onChange={super.handlePropChange('defaultValue')}
      />
    );
  }
}

EmailProps.defaultProps = {
  data: defaultData
};